<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录测试</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .login-box {
            background: white;
            padding: 40px;
            border-radius: 16px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            text-align: center;
        }
        
        h1 {
            margin: 0 0 8px 0;
            font-size: 24px;
            font-weight: 600;
            color: #333;
        }
        
        p {
            margin: 0 0 30px 0;
            font-size: 14px;
            color: #666;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .input-field {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            box-sizing: border-box;
        }
        
        .input-field:focus {
            outline: none;
            border-color: #409eff;
            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
        }
        
        .login-btn {
            width: 100%;
            padding: 12px;
            background: #409eff;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            margin-bottom: 20px;
        }
        
        .login-btn:hover {
            background: #337ecc;
        }
        
        .info {
            font-size: 12px;
            color: #999;
        }
        
        .info p {
            margin: 0;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
        }
    </style>
</head>
<body>
    <div class="login-box">
        <h1>气象站管理系统</h1>
        <p>Weather Station Management System</p>
        
        <div class="form-group">
            <input 
                id="username" 
                type="text" 
                placeholder="用户名" 
                class="input-field"
                value="admin"
            />
        </div>
        
        <div class="form-group">
            <input 
                id="password" 
                type="password" 
                placeholder="密码" 
                class="input-field"
                value="123456"
            />
        </div>
        
        <button 
            id="loginBtn" 
            class="login-btn"
        >
            登录
        </button>
        
        <div class="info">
            <p>默认账号：admin / 123456</p>
        </div>
    </div>

    <script>
        document.getElementById('loginBtn').addEventListener('click', function() {
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            if (!username || !password) {
                alert('请输入用户名和密码');
                return;
            }
            
            // 模拟登录
            if ((username === 'admin' || username === 'user') && password === '123456') {
                alert('登录成功！');
                // 保存登录状态
                localStorage.setItem('token', 'mock-jwt-token-' + Date.now());
                localStorage.setItem('username', username);
                // 跳转到主应用
                window.location.href = '/';
            } else {
                alert('用户名或密码错误');
            }
        });
        
        // 回车键登录
        document.addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                document.getElementById('loginBtn').click();
            }
        });
    </script>
</body>
</html> 